<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>投诉</title>
	
	
	<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"></script>
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5.4.2/themes/icon.css"/>
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5.4.2/themes/black/easyui.css"/>
                                               
<style type="text/css">
</style>
<title>three</title>
</head>   
<body>
	<link rel="stylesheet" type="text/css" href="css/llj/Complaint_css.css"> 
	<script type="text/javascript" src="js/common.js"></script>	
<script type="text/javascript">   


$(function(){
	 $("#Complaint_deleverId").hide();
	 $("#ComplaintAddLog").dialog("close");   
	 
  	 $("#ComplaintDgrid").datagrid({
		fit:true,border:false,
		pageSize:8,pageList:'[5,8,9,10,20]',
		fitColumns:true,
		url:'searchComplainAllM',method:'get',
		toolbar:'#Complain_tb',             
		title:'',             
		pagination:true, columns:[[             
        {field:'cc',width:1,checkbox:true},        
        {field:'comId',title:'ID',width:1}, 
        {field:'comTheme',title:'投诉主题',width:2}, 
        {field:'complainContain',title:'分类',width:2},
        {field:'customerName',title:'对应客户',width:2},   
        {field:'comDatetime',title:'日期',width:1,hidden:true},
        {field:'comUrgency',title:'紧急程度',width:2},    
        {field:'comFistReceiverName',title:'首问接待人',width:2},  
        {field:'comDealResult',title:'处理结果',width:1},   
        {field:'comPeople',title:'投诉人',width:2},   
        {field:'bb',width:3,title:'操作', formatter:function(value, row, index){         
                var btn = '<a class="llj-complaint-edit" onclick="editOrder('+row.comId+')" href="javascript:void(0)" class="easyui-linkbutton"></a>';
                var btn2 = '<a class="llj-complaint-delete" onclick="deleteOrder('+row.comId+')" href="javascript:void(0)" class="easyui-linkbutton"></a>'; 
                var btn3 = '<a class="llj-complaint-cus" onclick="DetailsOrder('+row.comId+')" href="javascript:void(0)" class="easyui-linkbutton"></a>'; 
                return btn+btn2+btn3;           
            }  
        }    
    ]],  
    onLoadSuccess:function(data){     
        $('.llj-complaint-edit').linkbutton({text:'编辑',plain:true,iconCls:'icon-edit'});  
        $('.llj-complaint-delete').linkbutton({text:'删除',plain:true,iconCls:'icon-zj-delete'}); 
        $('.llj-complaint-details').linkbutton({text:'视图',plain:true,iconCls:'icon-orderinfo'});
        $('.llj-complaint-cus').linkbutton({plain:true,iconCls:'icon-customer'}); 
    }     
	});		       
});

   var num=1;
   var numProgress=1;
   var numReback=1;
   var numSure=1;
   var numRemark=1;
   $(function(){
  	 $("#Complaint_comboboxType").combobox({
  		 url:'',
  		 valueFiled:'',
  		 textField:'',
  		 
  	 });
  	   $("#Complaint_textareaDesc").focus(function(){   
  		 if(num==1){      
  			$(this).animate({height:"55"}) ;       
  			num==2;    
  		 }   
  	 }); 
  	   $("#Compt_details").focus(function(){
	     if(numProgress==1){     
		   $(this).animate({height:'55'});
		   numProgress==2;  
	   } 
  	   });
  	   $("#Compt_extareaReback").focus(function(){
  		 if(numReback==1){  
  		   $(this).animate({height:'55'});
  		   numReback==2;
  	   } 
  	   });
  	   $("#Compt_extareaSure").focus(function(){
  		 if(numSure==1){  
  		   $(this).animate({height:'55'});
  		   numSure==2;     
  	   } 
  	   });
  	   $("#Compt_extareaRemark").focus(function(){
  		   if(numRemark==1){
  			 $(this).animate({height:'55'});
  			 numRemark==2;  
  		   }
  	   })
   });
   function editOrder(comId){
		$("#ComplaintAddLog").dialog({href2:"editComplainMessage",title:"编辑客户投诉"});    
		$("#Complaint_form_data").form('load','searchComplainMessage?comId='+comId);  
		$("#ComplaintAddLog").dialog("open");      
  	} 
   $(function(){  
		$('#ComplainAdd').linkbutton({onClick:function() {         
			$("#ComplaintAddLog").dialog({href2:"addComplaintData",title:"新建客户投诉"});      
			$("#Complaint_form_data").form("clear"); 
			$("#Complaint_deleverId").val(1000);//根据id赋值        
			$("#ComplaintAddLog").dialog("open");             
		}    
	    });   
	});
   function deleteOrder(comId){
		$.messager.confirm('提示','确定要删除吗？',function(v){
			if(v){
				$.getJSON('delete_Complaint',{comId:comId},function(obj){
					if(obj=='"success"'){             
						alert("删除成功");     
					}else{      
						alert("删除成功");          
					}  
					$('#ComplaintDgrid').datagrid('reload');         
				});       
			}
		});
	}
   $(function(){
		$("#Complain_refresh_list_all").linkbutton({
			onClick : function() {  
				$('#ComplaintDgrid').datagrid({  
					pageNumber : 1,  
					url : 'to_Complaint'        
				});    
				$("#ComplaintDgrid").datagrid("reload");
			}      
		});
		
		$("#Complaint_SearchCust").linkbutton({onClick:function(){
			var a=$("#Complaint_pytANDgjz").val();    
			alert(a);   
		}});
		
		$("#Complain_deleteMore").linkbutton({onClick:function(){
			var Rows=$("#ComplaintDgrid").datagrid("getSelections");
			if(Rows.length==0){                          
				alert("请至少选择一行数据");
				return false;
			} 
			$.messager.confirm("确认","要删除所有所选记录?",function(isDelete){
				if(isDelete){
					var strIds="";
					for(var i=0;i<Rows.length;i++){
    					strIds+=Rows[i].comId+",";
    				}        
    				//循环切割 
    				strIds=strIds.substr(0,strIds.length-1);    
    				alert("输出："+strIds);        
    				$.getJSON("complainDeleteMoreData",{strIds:strIds},function(obj){
   					 if(obj=='success'){                                            
   			    		 $.messager.alert("提示","删除成功！");
   			    	 }else{
       				     $.messager.alert("提示信息","删除失败！",'warning');
       				 }     
   					 $('#ComplaintDgrid').datagrid('reload');        
   				 }) 
				}
			})
			
		}});
		
	})
	
	   $(function(){
		   $("#Complaint_aOne").linkbutton({onClick:function(){   
				 alert($('#ComplaintAddLog').dialog('options').href2);    
					  $("#Complaint_form_data").form({     
						url: $('#ComplaintAddLog').dialog('options').href2,
						method:"get",             
						onSubmit:function(params){ 
						      
							return $(this).form('validate');    
						},  
						success:function(v){
							alert(v);    
							var data='"success"';     
							if(v==data){  
								alert("操作成功");     
							}else{  
								alert(v);  
								alert("操作失败");  
							}
							$("#ComplaintAddLog").window("close");  
							$('#ComplaintDgrid').datagrid('reload');          
						}
					}).submit();      
				}});
	   });  
</script>    

	      
<!-- 数据列表显示 -->       
<table id="ComplaintDgrid" class="easyui-datagrid"></table>  
	    
		<div id="Complain_tb">
		<a><input
			class="easyui-searchbox"
			data-options="width:200,prompt:'投诉主题',       
			searcher:function(value,name){
				//修改datagrid的url
				$('#ComplaintDgrid').datagrid({pageNumber:1, url: 'getDataByTheme'});     
				//重新加载数据             
				$('#ComplaintDgrid').datagrid('load', {key:value});                        
			}"></a>       
			  
		<a id="ComplainAdd" href="javascript:void(0)" class="easyui-linkbutton"
			data-options="iconCls:'icon-add',plain:true">添加</a><a              
			id="Complain_refresh_list_all" href="javascript:void(0)" class="easyui-linkbutton"
			data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a id="Complain_deleteMore" href="javascript:void(0)" class="easyui-linkbutton"
			data-options="iconCls:'icon-cut',plain:true">批量删除</a>             
	   </div>    
	     
     
<!-- 新建编辑窗口 --> 
<div id="ComplaintAddLog" class="easyui-dialog" style="width: 580px; height:400; padding: 10px;"        
  data-options="iconCls:'icon-add',resizable:true,modal:true,closed:false">          
    
 
  <div class="ComplaintLayoutDiv" class="easyui-layout" data-options="fit:true" style="border:solid 1px none">
    <form method="get" id="Complaint_form_data">      
     <div id="Complaint_centerDiv" data-options="region:'center'" style="padding:10px,border:solid 1px pink">    
        <div id="Complaint_div_kh">  
                <input type="text" name="comId" id="Complaint_deleverId">  
        	    <input name="customerName" id="Complaint_inputName" class="easyui-textbox" data-options=" label: '客户:',labelPosition: 'left',labelWidth:60,required:true,
							buttonText:'选择客户',required:true, width:300,
							onClickButton:function(){         
							getCustomer(function(row){      
							alert(row.custId);                  
							alert(row.custCname);                               
							   $('#Complaint_deleverId').textbox('setValue',row.custId);     
							   $('#Complaint_inputName').textbox('setText',row.custCname);                  
							})                                     
							}" >          
        </div> 
         
            
        <div class="Complaint_same" id="Complaint_div_pyt">
                 <input class="easyui-textbox" id="Complaint_pytANDgjz" data-options="prompt:'拼音头.编号.关键字',width:150"> 
        		 <a id="Complaint_SearchCust" class="easyui-linkbutton" data-options="iconCls:'icon-search'"></a>  
        		 <a id="Complaint_viewCust" class="easyui-linkbutton" data-options="iconCls:'icon-search'"></a>  
        </div> 

          
        <div class="Complaint_same">
              <input name="comTheme" class="easyui-textbox" name="comTheme" data-options="label:'投诉主题:',
              labelPosition:'left',labelWidth:68,width:300,required: true, ">  
        </div> 
        
        
        <div class="Complaint_same">    
              <input name="comFistReceiverName" class="easyui-textbox" data-options="label:'首位接待人:',labelWidth:68">  
        </div>            
        <div id="Complaint_type">
              <input name="complainContain" class="easyui-combobox" data-options="   
              label:'分类:',labelWidth:35,width:180,panelHeight:'auto',valueField:'complainId',textField:'complainContain',
              url:'searchComplainType',required: true,editable:false"                     
              >       
        </div>      
             
        <div class="Complaint_same">  
              <div class="Complaint_describleD" style="margin-top:20px,width:20px">描述:</div>
              <div class="Complaint_textareaDesc"><textarea name="comDescribe" id="Complaint_textareaDesc" rows="1" cols="62"></textarea></div>     
        </div>  
         
        <div class="Complaint_same">    
              <div id="Complaint_date"></div><input name="comDatetime" type="text" class="easyui-datebox" requinone ="requinone" 
              data-options="label:'日期:',required: true, 
              labelWidth:70,width:200,editable:false"></input> </div>    
        
        <div class="Complaint_same">  
              <span>投诉人：</span>
              <div id="Complaint_complain"><input id="Complaint_complainMan" name="comPeople" class="easyui-text" data-options="panelHeight:'auto'"></div>             
        </div>
           
        
        <div class="Complaint_same">
              <span>紧急程度：</span>
              <input id="Compt_rdo1" name="comUrgency" type="radio" value="2" name="">非常紧急 
              <input id="Compt_rdo1" name="comUrgency" type="radio" value="1">急
              <input id="Compt_rdo1" name="comUrgency" type="radio" value="0">普通        
        </div> 
        
        
        <div class="Complaint_same">
              <div id="Compt_detailP_S">处理过程:</div>    
              <div id="Compt_progressD"><textarea name="comDealProcess" id="Compt_details" rows='1' cols="62"></textarea></div> 
        </div>  
        
             
        <div class="Complaint_same"> 
              <span>处理结果：</span>
              <input id="Compt_result1" name="comDealResult" type="radio" value="0">未处理
              <input id="Compt_result1" name="comDealResult" type="radio" value="1">处理中
              <input id="Compt_result1" name="comDealResult" type="radio" value="2">处理完成         
        </div>   
        
        
        <div class="Complaint_same">  
              <span>花费时间：</span>  
              <div class="Complaint_usertime"><input name="dealContain" class="easyui-combobox" data-options="width:200,panelHeight:'auto',
              valueField:'dealId',textField:'dealContain',url:'searchComplainDealTime',required: true,editable:false"> 
              <a class="easyui-linkbutton" data-options="iconCls:'icon-search'"></a>           
              </div>                     
        </div>
        
        
        <div class="Complaint_same">
              <div id="Compt_divReback">客户反馈:</div>               
              <div id="Compt_Contain_extareaReback"><textarea name="comFeedback" id="Compt_extareaReback" rows="1" cols="62"></textarea></div>
        </div> 
        
        
        <div class="Complaint_same">    
              <div id="Compt_divSure">回访确认:</div>  
              <div id="Compt_Contain_extareaSure">
	              <input name="comSure" type="radio" value="0">未确认
	              <input name="comSure" type="radio" value="1">已确认    
              </div> 
        </div>   
        
           
        <div class="Complaint_same">
              <p id="Compt_remark">备注:</p> 
              <div id="Compt_Contain_Remark"><textarea name="comRemarks" id="Compt_extareaRemark" rows="1" cols="62"></textarea></div>
        </div>         
     </div>     
         
     <div data-options="region:'south'" style="border:solid 1px none">
          <a id="Complaint_aOne" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true">提交</a>    
          <a class="easyui-linkbutton" data-opions="iconCls:'icon-cancel',plain:true" href='javascript:void(0)' 
          onclick="javascript:$('#ComplaintAddLog').window('close')">取消</a>      
     </div>  
       
     </form>              
     </div> 
     </div> 

<!-- 外键查询显示窗口  -->
     
     
	        

</body>
</html>